@include('layouts.homeheader')
{{--引入jQuery--}}
<script src="{{asset('public/jquery-1.8.2.min.js')}}"></script>
<script src="{{asset('public/sytle/assets/global/plugins/jquery.min.js')}}" type="text/javascript"></script>
<script>

	$(function(){
		// top位置的切换
		var c = 0;

		$(".c_for_select").click(function () {
			if(c==0){
				$(this).next('.select_city').slideDown();
				c=1;
			}else{
				$(".select_city").slideUp();
				c=0;
			}
		});
		// document部分的切换
		$(document).click(function(){
			$(".select_city").slideUp();
			c=0;
		})
		// bottom部分的阻止冒泡
		$(".for_select").click(function(event){
			// 阻止冒泡
			event.stopPropagation();
		})

		//城市选择
		$('.select_city .cur li a span').click(function(){
			var cityname = $(this).html();
			var $ctid = $(this).attr('code');
			//alert($ctid);
//			alert(cityname);
			$(this).parents('.select_city').prev('input').val(cityname);
			$(".select_city").slideUp();
			c=0;
			//城市与门店
			$_this = $(this);

			$.post("{{url('duanzu/citystore')}}/"+$ctid,{'_token':"{{csrf_token()}}",'ctid':$ctid},function(data){
//				alert(data);
				str = '<ul class="cur">';
//				alert(data);

				$.each(data,function(k,v){

					str += '<li><a href="javascript:;"><span class="on_click" code='+v.menid+'  home="false">'+v.mname+'</span></a></li>'
				});
				str += '</ul>';

				$_this.parents('.for_select').siblings('.for_select').find('.select_city').html(str);


			})
		})
		//门店选择
		$('.select_city').delegate('.cur li a .on_click','click',function(){
			//$(this).css({border:"1px solid green"});
			var storename = $(this).html();
			//alert(storename)
			$(this).parents('.select_city').prev('input').val(storename);

			$(this).parents('li').siblings().find('.on_click').removeAttr('home');

			$(".select_city").slideUp();
			c=0;

		})
		//筛选
		$('.p_searchBtn').click(function(){
			var qcplace = $('#qcplace').val();
			var qctime = $("#qcdata").val();
			$.post("{{url('duanzu/formdata')}}",{'_token':"{{csrf_token()}}",'qcplace':qcplace,'qctime':qctime},function (data1) {
				str1='';
				$.each(data1,function(k,v){
					str1 +='<tr><td class="p_pic"><img src="'+v.listView+'" width="230" height="130"></td><td class="p_info"><p class="p_name">'+v.carname+'</p> <p class="p_oth">三厢 | '+v.px+''+v.qdfs+' | 乘坐'+v.zw+'人</p><div class="p_alltips"><i class="p_tip p_bh_remen">热门车</i><i class="p_tip p_bh_xin">新车型</i> </div><div class="p_bh_sale"><a class="p_hui"><span class="p_bred">惠</span><i class="p_sale_con">每租1天减10元，最多可减300元！</i></a></div> </td><td class="p_ord"><div class="p_order_box"><div class="p_od_price"><div class="p_houfu"></div><div class="p_car_price"><span class="p_pri_ye"> <em class="p_rmb">¥</em><em class="p_num">'+v.cprice+'</em><em class="p_unit">/日均</em></span><div class="p_totalPrice"><span class="p_f1 p_pri_all"> <em class="p_total">总价</em><em class="p_rmb">¥</em><em class="p_num">450</em><a href="javascript:;" class="p_xia"></a></span></div> </div><a href="javascript:;" class="p_od_btn" car_id="'+v.id+'">租 车</a></div></div></td></tr>';

				});
				$(".p_clist_tb").html(str1);
			})
		})



	})

</script>
{{--<div id="test" style="width: 100px;height: 100px;border: 1px solid red;">

</div>--}}
<!-- 搜素部分开始 -->
<div id="p_dz_sousuo">
	<form id="p_firstOrderInfo" style="height:auto;">
		<div class="p_dz_conbox p_zc_main">
			<div class="p_f1">
				<div class="p_choose_ul">
					<div class="p_ch_box">
						<label class="p_c_car">取车</label>


						<div class="for_select">
							<input type="text" class="p_iptcity p_citySD c_for_select" name="cityname"  value="北京">
							<div class="select_city" style="display:none">
								<ul class="cur">
									@foreach($city as $v)
										<li>
											<a href="javascript:;"><span class="" code="{{$v->ctid}}"  home="false">{{$v->cityname}}</span></a>
										</li>
									@endforeach
								</ul>
							</div>
						</div>



						<div class="for_select">
							<input type="text" class="p_iptSe p_iptst c_for_select" id="qcplace" value="首都机场T1/T2店">
							<div class="select_city" id="z_select_store" style="display:none">

							</div>
						</div>



						<div class="p_dz_smsc">
							<label class="p_cartxt">
								送车上门
								<span class="p_zc_switch_c"></span>
							</label>
						</div>
						<div class="p_clear"></div>
					</div>

					<div class="p_ch_box p_cardate" style="z-index:3;">
						<label class="p_c_date">
							取车时间
							<div class="p_indexjmh5">周一</div>
						</label>

						<div class="p_divin">
							<input type="text" class="p_ipdate" id="qcdata" value="2016-06-21">
						</div>

						<div class="p_cartime p_divin">
							<input type="text" class="p_ipttime" value="10:00">
						</div>

						<div class="p_clear"></div>
					</div>

					<div class="p_ch_box p_mt10">
						<label class="p_c_car">还车</label>

						<div class="for_select">
						<input type="text" class="p_iptcity p_citySD c_for_select"  value="北京">
							<div class="select_city" style="display:none">
								<ul class="cur">
									@foreach($city as $v)
										<li>
											<a href="javascript:;"><span class="" code="{{$v->ctid}}" enname="beijing" home="false">{{$v->cityname}}</span></a>
										</li>
									@endforeach
								</ul>
							</div>
						</div>

						<div class="for_select">
							<input type="text" class="p_iptSe p_iptst c_for_select" value="首都机场T1/T2店">
							<div class="select_city" id="h_select_store" style="display:none">

							</div>
						</div>



						<div class="p_dz_smsc">
							<label class="p_cartxt">
								上门取车
								<span class="p_zc_switch_c"></span>
							</label>
						</div>
						<div class="p_clear"></div>
					</div>

					<div class="p_ch_box p_cardate p_mt10" style="z-index:3;">
						<label class="p_c_date">
							还车时间
							<div class="p_indexjmh5">周一</div>
						</label>

						<div class="p_divin">
							<input id="rtdata" type="text" class="p_ipdate" value="2016-06-21">
						</div>

						<div class="p_cartime p_divin">
							<input type="text" class="p_ipttime" value="10:00">
						</div>

						<div class="p_clear"></div>
					</div>
				</div>

				<div class="p_choose_div">
					<i>租期：<em class="p_bred">2天</em>，不限里程</i>
					<a class="p_searchBtn" href="javascript:;">搜索车型</a>
				</div>
			</div>
		</div>
	</form>
</div>
<!-- 搜索部分结束 -->


<!-- 主要区域部分 -->
<div id="p_dz_main">
	<div class="p_dz_leftlist p_f1">
		<div class="p_dz_boxshd">
			<div class="p_cl_lbox">
				<p class="p_left_title">车型</p>
				<ul class="p_chexing">
					<script>
						$(function(){
							$('.p_chexing').find('a').click(function(){
								$(this).addClass('p_checked').parent().siblings().find('a').removeClass('p_checked');
								var carmodel = $(this).find('.p_cartxt').html();
								var price = $('.p_pri_num').find('li').filter('.p_checked').html();
								var brand = $('.p_car_brand').find('a').filter('.p_checked').html();
								$.post("{{url('duanzu/select')}}",{'_token':"{{csrf_token()}}",'carmodel':carmodel,'price':price,'brand':brand},function(data){
									$.each(data,function(k,v){
										str2 ='<tr><td class="p_pic"><img src="'+v.listView+'" width="230" height="130"></td><td class="p_info"><p class="p_name">'+v.carname+'</p> <p class="p_oth">三厢 | '+v.px+''+v.qdfs+' | 乘坐'+v.zw+'人</p><div class="p_alltips"><i class="p_tip p_bh_remen">热门车</i><i class="p_tip p_bh_xin">新车型</i> </div><div class="p_bh_sale"><a class="p_hui"><span class="p_bred">惠</span><i class="p_sale_con">每租1天减10元，最多可减300元！</i></a></div> </td><td class="p_ord"><div class="p_order_box"><div class="p_od_price"><div class="p_houfu"></div><div class="p_car_price"><span class="p_pri_ye"> <em class="p_rmb">¥</em><em class="p_num">'+v.cprice+'</em><em class="p_unit">/日均</em></span><div class="p_totalPrice"><span class="p_f1 p_pri_all"> <em class="p_total">总价</em><em class="p_rmb">¥</em><em class="p_num">450</em><a href="javascript:;" class="p_xia"></a></span></div> </div><a href="javascript:;" class="p_od_btn"  car_id="'+v.id+'">租 车</a></div></div></td></tr>';

									});
									$(".p_clist_tb").html(str2);
								},'json');
							})
//							$('.p_cx_sdjc').click(function(){
//								$(this).css('background-position','-200px -100px');
//							})
							$('.p_pri_num').find('li').click(function(){
								$(this).addClass('p_checked').siblings().removeClass('p_checked');
								var carmodel = $('.p_chexing').find('a').filter('.p_checked').find('.p_cartxt').html();
								var price = $('.p_pri_num').find('li').filter('.p_checked').html();
								var brand = $('.p_car_brand').find('a').filter('.p_checked').html();
								$.post("{{url('duanzu/select')}}",{'_token':"{{csrf_token()}}",'carmodel':carmodel,'price':price,'brand':brand},function(data){
									$.each(data,function(k,v){
										str3 ='<tr><td class="p_pic"><img src="'+v.listView+'" width="230" height="130"></td><td class="p_info"><p class="p_name">'+v.carname+'</p> <p class="p_oth">三厢 | '+v.px+''+v.qdfs+' | 乘坐'+v.zw+'人</p><div class="p_alltips"><i class="p_tip p_bh_remen">热门车</i><i class="p_tip p_bh_xin">新车型</i> </div><div class="p_bh_sale"><a class="p_hui"><span class="p_bred">惠</span><i class="p_sale_con">每租1天减10元，最多可减300元！</i></a></div> </td><td class="p_ord"><div class="p_order_box"><div class="p_od_price"><div class="p_houfu"></div><div class="p_car_price"><span class="p_pri_ye"> <em class="p_rmb">¥</em><em class="p_num">'+v.cprice+'</em><em class="p_unit">/日均</em></span><div class="p_totalPrice"><span class="p_f1 p_pri_all"> <em class="p_total">总价</em><em class="p_rmb">¥</em><em class="p_num">450</em><a href="javascript:;" class="p_xia"></a></span></div> </div><a href="javascript:;" class="p_od_btn"  car_id="'+v.id+'">租 车</a></div></div></td></tr>';

									});
									$(".p_clist_tb").html(str3);
								},'json');
							})
							$('.p_car_brand').find('a').click(function(){
								$(this).addClass('p_checked').parent().siblings().find('a').removeClass('p_checked');
								var carmodel = $('.p_chexing').find('a').filter('.p_checked').find('.p_cartxt').html();
								var price = $('.p_pri_num').find('li').filter('.p_checked').html();
								var brand = $('.p_car_brand').find('a').filter('.p_checked').html();
								$.post("{{url('duanzu/select')}}",{'_token':"{{csrf_token()}}",'carmodel':carmodel,'price':price,'brand':brand},function(data){
									$.each(data,function(k,v){
										str3 ='<tr><td class="p_pic"><img src="'+v.listView+'" width="230" height="130"></td><td class="p_info"><p class="p_name">'+v.carname+'</p> <p class="p_oth">三厢 | '+v.px+''+v.qdfs+' | 乘坐'+v.zw+'人</p><div class="p_alltips"><i class="p_tip p_bh_remen">热门车</i><i class="p_tip p_bh_xin">新车型</i> </div><div class="p_bh_sale"><a class="p_hui"><span class="p_bred">惠</span><i class="p_sale_con">每租1天减10元，最多可减300元！</i></a></div> </td><td class="p_ord"><div class="p_order_box"><div class="p_od_price"><div class="p_houfu"></div><div class="p_car_price"><span class="p_pri_ye"> <em class="p_rmb">¥</em><em class="p_num">'+v.cprice+'</em><em class="p_unit">/日均</em></span><div class="p_totalPrice"><span class="p_f1 p_pri_all"> <em class="p_total">总价</em><em class="p_rmb">¥</em><em class="p_num">450</em><a href="javascript:;" class="p_xia"></a></span></div> </div><a href="javascript:;" class="p_od_btn" car_id="'+v.id+'">租 车</a></div></div></td></tr>';

									});
									$(".p_clist_tb").html(str3);
								},'json');
							})

							$('.p_od_btn').live('click',function(){
								var car_id = $(this).attr('car_id');

								var borrow_menid = $('#z_select_store').find('.on_click[home]').attr('code');
								var return_menid = $('#h_select_store').find('.on_click[home]').attr('code');
								var borrow_time = $('#qcdata').val();
								var return_time = $('#rtdata').val();
								$.post("{{url('duanzu/save')}}",{'_token':"{{csrf_token()}}",'car_id':car_id,'borrow_menid':borrow_menid,'return_menid':return_menid,'borrow_time':borrow_time,'return_time':return_time},function (data) {
									if(data==1){
										location.href="{{url('orderSubmit')}}"
									}
								})
							})
						})
					</script>
					<li>
						<a href="javascript:;" class="p_checked">
							<i class="p_cx_bx"></i>
							<i class="p_cartxt">不限</i>
						</a>
					</li>

					@foreach($carModel as $v)
					<li>
						<a href="javascript:;">
							@if($v->mname=='手动紧凑型')
								<i class="p_cx_sdjc"></i>
							@elseif($v->mname=='经济型')
								<i class="p_cx_jj"></i>
							@elseif($v->mname=='商务型')
								<i class="p_cx_sw"></i>
							@elseif($v->mname=='豪华型')
								<i class="p_cx_hh"></i>
							@elseif($v->mname=='suv')
								<i class="p_cx_sdjc"></i>
							@elseif($v->mname=='6至15座商务')
								<i class="p_cx_zsw"></i>
							@elseif($v->mname=='个性车')
								<i class="p_cx_gx"></i>
							@elseif($v->mname=='电动车')
								<i class="p_cx_dd"></i>
							@endif
							<i class="p_cartxt">{{$v->mname}}</i>
						</a>
					</li>
					@endforeach


				</ul>
			</div>

			<div class="p_cl_lbox">
				<p class="p_left_title">价格<span class="p_sma12">(元)</span></p>
				<ul class="p_pri_range">
					<li class="p_bar1"><a href="javascript:;"><span class="p_w40"></span></a></li>
					<li><a href="javascript:;"><span class="p_w40"></span></a></li>
					<li><a href="javascript:;"><span class="p_w40"></span></a></li>
					<li><a href="javascript:;"><span class="p_w40"></span></a></li>
					<li><a href="javascript:;"><span class="p_w70"></span></a></li>
				</ul>
				<ul class="p_pri_num">
					<li class="p_checked p_w37">不限</li>
					<li class="p_w35">0</li>
					<li class="p_w42">150</li>
					<li class="p_w42">300</li>
					<li class="p_w37">500</li>
					<li class="p_w44 p_pri6">500+</li>
				</ul>
			</div>

			<div class="p_cl_lbox">
				<p class="p_left_title">品牌</p>
				<ul class="p_car_brand">
					<li class="p_all"><a href="javascript:;" class="p_checked">不限</a></li>
					@foreach($carBrand as $v)
					<li><a href="javascript:;">{{$v->bname}}</a></li>
					@endforeach


				</ul>
			</div>
		</div>
	</div>

	<!-- 车辆列表开始 -->
	<div class="p_dz_rightlist p_fr">
		<div class="p_dz_boxshd">
			<ul class="p_right_tab">
				<li class="p_tab p_cur p_w120"><a href="javascript:;">短租自驾</a></li>
				<li class="p_tab p_w142"><a href="javascript:;">工作日套餐<i>(4天)</i></a></li>
				<li class="p_tab p_w142"><a href="javascript:;">周租套餐<i>(7-27天)</i></a></li>
				<li class="p_tab p_w142"><a href="javascript:;">月租套餐<i>(28天+)</i></a></li>
				<li>
					<a href="javascript:;" class="p_seq">
						<i class="p_arblue_top"></i>
						<span>租金由低到高</span>
					</a>
				</li>
			</ul>

			<div class="p_clist_ct">
				<table class="p_clist_tb" border="0" cellpadding="0" cellspacing="0">

					<tr>
						<td class="p_pic"><img src="public/homestyle/image/klz.jpg" width="230" height="130"></td>

						<td class="p_info">
							<p class="p_name">雪佛兰科鲁兹</p>
							<p class="p_oth">三厢 | 1.6自动 | 乘坐5人</p>
							<div class="p_alltips">
								<i class="p_tip p_bh_remen">热门车</i>
								<i class="p_tip p_bh_xin">新车型</i>
							</div>
							<div class="p_bh_sale">
								<a class="p_hui">
									<span class="p_bred">惠</span>
									<i class="p_sale_con">每租1天减10元，最多可减300元！</i>
								</a>
							</div>
						</td>

						<td class="p_ord">
							<div class="p_order_box">
								<div class="p_od_price">
									<div class="p_houfu"></div>
									<div class="p_car_price">
										<span class="p_pri_ye">
											<em class="p_rmb">¥</em>
											<em class="p_num">255</em>
											<em class="p_unit">/日均</em>
										</span>

										<div class="p_totalPrice">
											<span class="p_f1 p_pri_all">
												<em class="p_total">总价</em>
												<em class="p_rmb">¥</em>
												<em class="p_num">450</em>
												<a href="javascript:;" class="p_xia"></a>
											</span>
										</div>
									</div>
									<a href="javascript:;" class="p_od_btn">租 车</a>
								</div>
							</div>
						</td>
					</tr>



					<tr>
						<td class="p_pic"><img src="public/homestyle/image/klz.jpg" width="230" height="130"></td>

						<td class="p_info">
							<p class="p_name">雪佛兰科鲁兹</p>
							<p class="p_oth">三厢 | 1.6自动 | 乘坐5人</p>
							<div class="p_alltips">
								<i class="p_tip p_bh_remen">热门车</i>
								<i class="p_tip p_bh_xin">新车型</i>
							</div>
							<div class="p_bh_sale">
								<a class="p_hui">
									<span class="p_bred">惠</span>
									<i class="p_sale_con">每租1天减10元，最多可减300元！</i>
								</a>
							</div>
						</td>

						<td class="p_ord">
							<div class="p_order_box">
								<div class="p_od_price">
									<div class="p_houfu"></div>
									<div class="p_car_price">
										<span class="p_pri_ye">
											<em class="p_rmb">¥</em>
											<em class="p_num">255</em>
											<em class="p_unit">/日均</em>
										</span>

										<div class="p_totalPrice">
											<span class="p_f1 p_pri_all">
												<em class="p_total">总价</em>
												<em class="p_rmb">¥</em>
												<em class="p_num">450</em>
												<a href="javascript:;" class="p_xia"></a>
											</span>
										</div>
									</div>
									<a href="javascript:;" class="p_od_btn">租 车</a>
								</div>
							</div>
						</td>
					</tr>

					<tr style="height:79px;" class="p_yizucheliang">
						<td colspan="4">
							<span class="p_shownum">已租满车辆(15)</span>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
	<!-- 车辆列表结束 -->
</div>
<!-- 主要区域部分结束 -->



<!-- 底部选车记录开始 -->
<div id="p_bottomsel">
	<div class="p_boxdown">
		<div class="p_rightbox">
			<p class="p_title">选车记录(0)</p>
			<div class="p_record">
				<p class="p_msg">您目前还没有选车记录！</p>
			</div>
		</div>
	</div>
</div>
<!-- 底部选车记录结束 -->


<!-- 租车说明-公共部分 -->
<div id="p_zcfootmenu">
	<div class="p_zcmain">
		<dl class="p_wyd">
			<dt>
				<a href="javascript:;">租车</a>预订说明
			</dt>
			<dd>
				<a href="javascript:;">服务时间</a>
				<a href="javascript:;">待租车况</a>
				<a href="javascript:;">服务预订</a>
				<a href="javascript:;">短租产品</a>
				<a href="javascript:;">租车资格</a>
				<a href="javascript:;">取还车说明</a>
			</dd>
		</dl>

		<dl class="p_why">
			<dt>
				会员管理
			</dt>
			<dd>
				<a href="javascript:;">会员章程</a>
				<a href="javascript:;">会员细则</a>
				<a href="javascript:;">定级积分</a>
			</dd>
		</dl>

		<dl class="p_wsj">
			<dt>
				紧急事务处理
			</dt>
			<dd>
				<a href="javascript:;">保险责任</a>
				<a href="javascript:;">理赔说明</a>
				<a href="javascript:;">事故处理</a>
				<a href="javascript:;">救援及备用车</a>
			</dd>
		</dl>

		<dl class="p_wfy">
			<dt>
				<a href="javascript:;">租车</a>费用及结算
			</dt>
			<dd>
				<a href="javascript:;">价格说明</a>
				<a href="javascript:;">结算流程</a>
				<a href="javascript:;">储值卡</a>
				<a href="javascript:;">积分</a>
			</dd>
		</dl>

		<dl class="p_wbz">
			<dt>
				帮助中心
			</dt>
			<dd>
				<a href="javascript:;">常见问题</a>
				<a href="javascript:;">新手上路</a>
				<a href="javascript:;">违章查询</a>
				<a href="javascript:;">服务规则 </a>
			</dd>
		</dl>
	</div>
</div>
<!-- 租车说明-公共部分结束 -->



<!-- 页脚公共部分 -->
		<div id="p_zc_footcopyright">
			<div class="p_zcmain">
				<div class="p_ainfor">
					<a href="javascript:;">关于我们</a>
					<a href="javascript:;">投资者关系</a>
					<a href="javascript:;">新闻中心</a>
					<a href="javascript:;">加盟合作</a>
					<a href="javascript:;">隐私保护</a>
					<a href="javascript:;">网站导航</a>
					<a href="javascript:;">联系我们</a>
					<a href="javascript:;">招贤纳士</a>
					<a class="p_engwz">
						English
						<i class="p_eng_icon"></i>
					</a>
				</div>
				<div class="p_zc_copyright">
					<p class="p_f1">
						Copyright©2008-2016 www.zuche.com All Rights Reserved.　神州租车官网 京ICP备10005002号   京公网安备号 11010502026705
					</p>
					<p class="p_fr">
						如果您对神州租车网站有任何意见，欢迎发送邮件到 
						<a href="javascript:;" class="p_yellowmailt">web@zuche.com</a>
					</p>
					<p class="p_clear p_pt10">
						<a href="javascript:;" class="p_sz_k"></a>
						<a href="javascript:;" class="p_sz_c"></a>
					</p>
				</div>
			</div>
		</div>
<!-- 页脚公共部分结束 -->


<!-- 右侧浮动开始 -->
<div id="p_righttool"></div>

<div class="p_zc_tool">
	<ul class="p_ulbox">
		<li>
			<a href="javascript:;" class="abox">
				<span class="p_zc_asset_i"></span>
				资
				<br>
				产
			</a>
		</li>

		<li>
			<a href="javascript:;" class="abox">
				<span class="p_zc_record_i"></span>
				订
				<br>
				单
			</a>
		</li>

		<li>
			<a href="javascript:;" class="abox">
				<span class="p_zc_phone_i"></span>
				手
				<br>
				机
				<br>
				版
			</a>
		</li>
	</ul>
</div>

<div class="p_zc_foottool">
	<ul>
		<li>
			<a href="javascript:;"><span class="p_service"></span></a>
		</li>

		<li>
			<a href="javascript:;"><span class="p_help"></span></a>
		</li>

		<li>
			<a href="javascript:;"><span class="p_share"></span></a>
		</li>

		<li>
			<a href=""><span class="p_top"></span></a>
		</li>
	</ul>
</div>
<!-- 右侧浮动结束 -->
</body>
</html>